/*
 * @Author: lmk
 * @Date: 2022-05-26 15:47:23
 * @LastEditTime: 2022-05-27 10:01:23
 * @LastEditors: lmk
 * @Description: 
 */

import React from 'react';
interface Iprops {
  label:string | React.ReactNode,
  value?:string | number | React.ReactNode,
  unit?:string,
  className?:string
  colon?:boolean,
  onClick?:(item:any) => void
}
const LabelView = ({label,value='--',unit,className,colon=true,onClick}:Iprops) => {
return <div className={`flex items-center ${className}`} onClick={onClick}>
  <div className='mr-1.5 flex-none'>{label}{colon ? ":" : ''}</div>
  <div className='flex-auto'>
    {typeof value ==='string' ? (value  || '---') : value}
    {unit && <span>{unit}</span>}
  </div>
</div>
};

export default LabelView;
